const FormData = require('./formData')
import {commonUploadPicApi} from '../../service/common'
import {rgbDetectionSubmitApi} from '../../service/home'

// new 一个FormData对象  普通参数
let formData = new FormData()
const files = this.data.photosList.map(item => item.url)
formData.append('imageUrlList', files)
let data = formData.getData()
const header = {
  'content-type': data.contentType,
}
rgbDetectionSubmitApi({header, data: data.buffer}).then(rgbDetectionRes => {
  console.log(rgbDetectionRes);
})

// new 一个FormData对象  file参数
let formData = new FormData()
formData.appendFile('image', filePath)
let data = formData.getData()
const header = {
  'content-type': data.contentType,
}
commonUploadPicApi({header, data: data.buffer}).then(uploadPicRes => {
  console.log(uploadPicRes);
})